package com.guigu.eduservice.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.guigu.eduservice.entity.Article;
import com.guigu.eduservice.entity.ArticleCategory;
import com.guigu.eduservice.service.ArticleCategoryService;
import com.guigu.eduservice.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 文章分类表（用于管理平台资讯文章的分类） 前端控制器
 * </p>
 *
 * @author janecraft
 * @since 2025-09-27
 */
@RestController
@RequestMapping("/eduservice/articleCategory")
public class ArticleCategoryController {

    @Autowired
    private ArticleCategoryService articleCategoryService;


    //查询文章内容分类表
    @PostMapping("page/{pageNo}/{pageSize}")
    public PageInfo<ArticleCategory> getArticleCategoryAll(@PathVariable int pageNo, @PathVariable int pageSize){
        PageHelper.startPage(pageNo,pageSize);
        List<ArticleCategory> list = articleCategoryService.list();
        PageInfo<ArticleCategory> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
}
